﻿<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%option explicit%>
<%
Dim RZ_IN
RZ_IN=1
%>
<!--#include file="../conn.inc.asp" -->
<!--#include file="admin_inc/admin.function.asp" -->
<!--#include file="admin_inc/admin.sqlfunction.asp" -->
<!--#include file="../asp/speciallist.asp" -->
<%
checkadmin(1)
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>生成列表页</title>
<link type="text/css" href="style/style.css" rel="stylesheet" rev="stylesheet"/>
</head>
<body style="margin-left:50px;margin-top:0px;">
<%
Dim pages, i, num, filepath
Call ChangeStatic(1,0)
S_RZPARAM.QueryString=RZ_PRE_SPECIAL_LIST&S_LANG&"-s0.html"
S_TEMPLATE=""
S_HTMLMBUFFER=""
Set S_CRUMB=new RZCrumb 
Call SpecialList(1)
Call CreateFolders(GetPath(RZ_HTML_PATH&"/"&RZ_PRE_SPECIAL_LIST&S_LANG))
filepath=GetPath(RZ_HTML_PATH&"/"&RZ_PRE_SPECIAL_LIST&S_LANG&"/s0.html")
Call SaveFile(filepath,S_HTMLMBUFFER)
pages=CaculatePage(CaculateRecord(),app("rz_perpage_speciallist"))
num=1
If pages>1 Then 
	For i=1 To pages
	S_RZPARAM.QueryString=RZ_PRE_SPECIAL_LIST&S_LANG&"-s0p"&i&".html"
	S_TEMPLATE=""
	S_HTMLMBUFFER=""
	Call SpecialList(1)
	filepath=GetPath(RZ_HTML_PATH&"/"&RZ_PRE_SPECIAL_LIST&S_LANG&"/s0p"&i&".html")
	Call SaveFile(filepath,S_HTMLMBUFFER)
	num=num+1
	Next 
End If 


If app("rz_language")=2 Then 
	Call ChangeStatic(1,1)
	Set S_RZPARAM=new RZParam
	S_RZPARAM.QueryString=RZ_PRE_SPECIAL_LIST&S_LANG&"-s0.html"
	S_TEMPLATE=""
	S_HTMLMBUFFER=""
	Set S_CRUMB=new RZCrumb 
	Call SpecialList(1)
	Call CreateFolders(GetPath(RZ_HTML_PATH&"/"&RZ_PRE_SPECIAL_LIST&S_LANG))
	filepath=GetPath(RZ_HTML_PATH&"/"&RZ_PRE_SPECIAL_LIST&S_LANG&"/s0.html")
	Call SaveFile(filepath,S_HTMLMBUFFER)
	num=num+1
	If pages>1 Then 
		For i=1 To pages
		S_RZPARAM.QueryString=RZ_PRE_SPECIAL_LIST&S_LANG&"-s0p"&i&".html"
		S_TEMPLATE=""
		S_HTMLMBUFFER=""
		Call SpecialList(1)
		filepath=GetPath(RZ_HTML_PATH&"/"&RZ_PRE_SPECIAL_LIST&S_LANG&"/s0p"&i&".html")
		Call SaveFile(filepath,S_HTMLMBUFFER)
		num=num+1
		Next 
	End If 
End If 

Function CaculateRecord()
Dim rs,sql,rcount
rcount=0
Set rs=server.CreateObject("ADODB.Recordset")
sql="select * from c_special where visible=1"
rs.open sql,conn,1,1
rcount=rs.recordcount
rs.close
Set rs=Nothing 
CaculateRecord=rcount
End Function 
%>
<span style="color:blue;">成功生成<%=num%>个列表</span>
<script type="text/javascript">
<!--
	parent.document.getElementById("mon").value="speciallistdone";
//-->
</script>

</body>
</html>